<!--
 * @FilePath     : /study_code/html/input-type-file-get-filemsg.html
 * @Description  : input type="file1" 获取文件信息
 * @Date         : 2025-04-26 08:36:26
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-26 08:36:26
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>

  <body>
    <input id="myinput" type="file" accept="image/*" multiple="true" />
    <button id="btn">获取已选文件信息</button>
    <script>
      const myinputDOMEle = document.querySelector('#myinput')
      btn.onclick = function () {
        console.log(myinputDOMEle.files)
      }

      // 已选文件信息
      /* FileList {
      "0": {
        lastModified: 1673924651682,
        lastModifiedDate: Tue Jan 17 2023 11: 04: 11 GMT + 0800(中国标准时间) { },
        name: "logo.png",
        size: 97285,
        type: "image/png",
        webkitRelativePath: "",
        [[Prototype]]: File
      },
      "1": {
        lastModified: 1676371218603,
        lastModifiedDate: Tue Feb 14 2023 18:40:18 GMT+0800 (中国标准时间) {},
        name: "logo2.png",
        size: 12013,
        type: "image/png",
        webkitRelativePath: "",
        [[Prototype]]: File
      }
      [[Prototype]]: FileList
    } */
    </script>
  </body>
</html>
